package com.syq.controller;

import com.syq.dto.R;
import com.syq.pojo.SysScene;
import com.syq.service.SysSceneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/scenes")
public class SysSceneController {
    private SysSceneService sysSceneService;

    @Autowired
    public void setSysSceneService(@RequestBody SysSceneService sysSceneService) {
        this.sysSceneService = sysSceneService;
    }

    @PostMapping("/scene")
    public R addSecne(SysScene sysScene){
        sysSceneService.addScene(sysScene);
        return R.setOk();
    }

    @GetMapping("/scene")
    public R findAllSceneByUserId(){
        List<SysScene> sceneList = sysSceneService.findAllSceneByUserId();
        return R.setOk();
    }
}
